import React, { useEffect, useState } from 'react';

const UseTest = () => {
    const [obj, setObj] = useState({a: 1})

    useEffect(() => {
        console.log(obj)
    },[obj])

    return(
        <div onClick={()=>setObj({a: 2})} >{obj.a}</div>
    )
}

export default UseTest